﻿<%@ MasterType VirtualPath="~/Main.master" %>

<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true"
    CodeBehind="Profile.aspx.cs" Inherits="Touch2Like.Web.Customer.Profile" %>

<asp:Content ID="Content1" ContentPlaceHolderID="headcontent" runat="server">
    <link href="/css/smoothness/jquery-ui-1.9.1.custom.min.css" rel="stylesheet" type="text/css" />
    <script src="/js/jquery-ui-1.9.1.custom.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $("#btn_AddAddress").click(function () {
                $("#ifrEditTag").attr("src", "Popup/AddAddress.aspx");
                $("#dialog").dialog({ height: 600, width: 800, modal: true, resizable: false, minWidth: 800, minHeight: 600, maxWidth: 800, maxHeight: 600 });
            });
            $(".edititem").click(function () {
                $("#ifrEditTag").attr("src", "Popup/AddAddress.aspx?ListID=" + $(this).attr("item-value"));
                $("#dialog").dialog({ height: 600, width: 800, modal: true, resizable: false, minWidth: 800, minHeight: 600, maxWidth: 800, maxHeight: 600 });
            });
            $("#cb_All").click(function () {
                if ($(this).attr("checked")) {
                    $(".cb_Single :checkbox").attr("checked", true);
                } else {
                    $(".cb_Single :checkbox").attr("checked", false);
                }
            });
            $("#btn_Edit").click(function () {
                $("#ifrEditTag").attr("src", "Popup/EditUserInfo.aspx");
                $("#dialog").dialog({ height: 300, width: 300, modal: true, resizable: false, minWidth: 300, minHeight: 300, maxWidth: 300, maxHeight: 300 });
            });
            $("#btn_ChangePassword").click(function () {
                $("#ifrEditTag").attr("src", "Popup/EditPassword.aspx");
                $("#dialog").dialog({ height: 300, width: 300, modal: true, resizable: false, minWidth: 300, minHeight: 300, maxWidth: 300, maxHeight: 300 });
            });
        });

        function hideDialog() {
            $("#dialog").dialog("close");
        }

        function ConfirmMsg(msg) {
            if (confirm(msg)) {
                return true;
            } else {
                event.cancelBubble = true;
                event.returnValue = false;
                return false;
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="maincontent" runat="server">
    <div id="dialog" title="Edit Profile" style="display: none; padding: 0px;">
        <iframe id="ifrEditTag" src="Popup/AddAddress.aspx" frameborder="0" style="width: 299px;
            height: 250px;"></iframe>
    </div>
    <div id="header_bottom">
        <div class="container clearfix">
            <div class="sidebar" style="width: 158px; min-height:200px;">
            <div><a href="/Customer/Dashboard.aspx">Dashboard</a></div>
                                <div>
                    <a href="/Customer/Profile.aspx">My Account</a></div>
                    <div>
                    <a href="/Customer/Main.aspx">Manage Tags</a></div>
<%--                <div>
                    <a href="/Customer/Orders.aspx">Orders</a></div>--%>

                <div>
                    <a href="/Customer/statistics.aspx">Statistics</a></div>
            </div>
            <div class="grid8 table_wrapper">
                <div style="height: 40px;">
                    <input id="btn_Edit" type="button" class="Submit" value="Edit Information" />
                    <input id="btn_ChangePassword" type="button" class="Submit" value="Change Password" />
                </div>
                <div>
                    <asp:Literal ID="lb_UserInfo" runat="server"></asp:Literal>
                </div>
                <div style="height: 40px; display:none;">
                    <input id="btn_AddAddress" type="button" class="Submit" value="Add Address" />
                    <asp:Button ID="btn_Delete" runat="server" CssClass="Submit" Text="Delete" OnClientClick="return ConfirmMsg('Are you sure you want to delete these items.');"
                        OnClick="btn_Delete_Click" />
                </div>
                <asp:GridView ID="GridView_Address" runat="server" AutoGenerateColumns="false" Width="700px"
                    AllowPaging="true" AllowSorting="true" PageSize="20" OnPageIndexChanging="GridView_Address_PageIndexChanging"
                    OnSorting="GridView_Address_Sorting">
                    <Columns>
                        <asp:TemplateField SortExpression="ListID">
                            <ItemTemplate>
                                <asp:CheckBox ID="cb_ListID" runat="server" CssClass="cb_Single" />
                                <asp:HiddenField ID="tb_ListID" runat="server" Value='<%#Eval("ListID") %>' />
                            </ItemTemplate>
                            <HeaderTemplate>
                                <input type="checkbox" id="cb_All" />
                            </HeaderTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="First Name" SortExpression="FirstName">
                            <ItemTemplate>
                                <%#Eval("FirstName")%>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Last Name" SortExpression="LastName">
                            <ItemTemplate>
                                <%#Eval("LastName")%>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Phone" SortExpression="Phone">
                            <ItemTemplate>
                                <%#Eval("Phone")%>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Email" SortExpression="Email">
                            <ItemTemplate>
                                <%#Eval("Email")%>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Address" SortExpression="Address">
                            <ItemTemplate>
                                <%#Eval("Address")%><br />
                                <%#Eval("Address2")%><br />
                                <%#Eval("City")%>,
                                <%#Eval("Country")%>,
                                <%#Eval("State")%><br />
                                <%#Eval("Company")%><br />
                                <%#Eval("Postal")%>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <input type="button" value="Edit" item-value='<%#Eval("ListID") %>' class="Submit edititem" />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
            </div>
        </div>
    </div>
</asp:Content>
